/**
 * DPHW3Display - Prints items using the defined output type of the user.
 * CS575 Software Design
 * Group 6
 * Group Members: Anthony Davidson, Kendra Scheesley, Lyndsey Whitman, Stephen Zakrewsky
 * Date: May 19, 2012
 * Main Author(s): Kendra Scheesley, Lyndsey Whitman
 * 
 * Modified: 6/1 Stephen Zakrewsky
 */

package edu.drexel.cs575.a3;

import java.text.NumberFormat;
import java.io.*;

import edu.drexel.cs575.a3.location.LocaleEnum;
import edu.drexel.cs575.a3.location.Location;
import edu.drexel.cs575.a3.location.LocationProvider;

public class DPHW3Display implements Display
{
	private LocaleEnum locale;
	
	DPHW3Display()
	{
		Location location = LocationProvider.getInstance().getLocation();
		locale = location.getLocaleEnum();
	}
	
	DPHW3Display(LocaleEnum le)
	{
		this.locale = le;
	}
	
	public void setLocaleEnum(LocaleEnum le)
	{
		this.locale = le;
	}
	
	@Override
	public void displayItem(String name, double price, double weight, String units)
	{
	    NumberFormat currencyFormat   = NumberFormat.getCurrencyInstance(locale.getLocale());

		String displayMsg = "Total price of " + name + ", " + currencyFormat.format(price);
		
		this.display(displayMsg);
	}
	
	@Override
	public void display(String text)
	{
		System.out.println(text);

	}
	
	@Override
	public void setOutputStream(OutputStream out)
	{
		

	}

}
